package com.rockcent.service;

import com.rockcent.common.common.PageResult;
import com.rockcent.mall.lib.dto.ChannelDto;
import com.rockcent.mall.lib.dto.ChannelStatisticsChartDto;

import java.util.List;

/**
 * Created by hone on 17-2-6.
 */
public interface MerchantChannelStatisticsService {

    /**
     * 访问次数
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @param channelId
     * @return
     */
    Long channelViewCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, Long channelId);

    /**
     * 访问次数 top 10
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @param groupBy
     * @param channelIds
     * @return
     */
    List<ChannelStatisticsChartDto> channelViewCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, String groupBy, List<Long> channelIds);

    /**
     * 访问人数
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @return
     */
    Long channelViewCustomerCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, Long channelId);

    /**
     * 访问人数 top 10
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @param groupBy
     * @param channelIds
     * @return
     */
    List<ChannelStatisticsChartDto> channelViewCustomerCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, String groupBy, List<Long> channelIds);

    /**
     * 销售数量
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @return
     */
    Long channelSaleCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, Long channelId);

    /**
     * 销售数量 top 10
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @param groupBy
     * @param channelIds
     * @return
     */
    List<ChannelStatisticsChartDto> channelSaleCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, String groupBy, List<Long> channelIds);

    /**
     * 下单人数
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @return
     */
    Long channelOrderCustomerCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, Long channelId);

    /**
     * 下单人数 top 10
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @param groupBy
     * @param channelIds
     * @return
     */
    List<ChannelStatisticsChartDto> channelOrderCustomerCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, String groupBy, List<Long> channelIds);

    /**
     * 核销数量
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @return
     */
    Long channelVerifyCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, Long channelId);

    /**
     * 核销数量 top 10
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @param groupBy
     * @param channelIds
     * @return
     */
    List<ChannelStatisticsChartDto> channelVerifyCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, String groupBy, List<Long> channelIds);

    /**
     * 核销人数
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @return
     */
    Long channelVerifyCustomerCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, Long channelId);

    /**
     * 核销人数 top 10
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @param groupBy
     * @param channelIds
     * @return
     */
    List<ChannelStatisticsChartDto> channelVerifyCustomerCount(Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, String groupBy, List<Long> channelIds);

    /**
     * 查找渠道列表
     * @param page
     * @param mallId
     * @param merchantId
     * @param startDate
     * @param endDate
     * @param typeIds
     * @param sourceType
     * @param channelIds
     * @return
     */
    PageResult<ChannelStatisticsChartDto> findChannels(PageResult page, Long mallId, Long merchantId, String startDate, String endDate, List<Long> typeIds, String sourceType, List<Long> channelIds);

    /**
     * 计算渠道产品品类数
     * @param mallId
     * @param merchantId
     * @param channelId
     * @return
     */
    Long computeChannelCategoryCount(Long mallId, Long merchantId, Long channelId);

    /**
     * 获取TOP5的活跃渠道
     * @param page
     * @param mallId
     * @param merchantId
     * @return
     */
    PageResult<ChannelDto> findTop5ActiveChannels(PageResult page, Long mallId, Long merchantId);
}
